'use strict'
const sequelize = require('../db');
const Sequelize = require('sequelize');

const User = sequelize.define('user', {
    //attributes 属性
    //表的字段（列名）
    UserName: {
        type: Sequelize.STRING(80),
        allowNull: false
    },

    PassWord: {
        type: Sequelize.STRING(20)
    }

}, {
    //options 选项
    timestamps: true //时间戳
});

const Book = sequelize.define('book', {
    BookName: {
        type: Sequelize.STRING,
        allowNull: false
    },
    Author: {
        type: Sequelize.STRING,
        allowNull: false
    },
    Quote: {
        type: Sequelize.STRING,
        allowNull: false
    }

}, {
    timestamps: true //时间戳
})

module.exports = {
    User: User,
    Book: Book
}